#!/usr/bin/perl -w

use strict;
use Test::More tests => 39;
use blib;
use Catalyst::Test 'Webpacus';

# test some URIs

my $test_site = 'hr';

foreach my $url (qw#
	/
	/search
	/search/results
	/search/results/ajax
	/search/results?all=a
	/search/results/ajax?all=a
	/search/results?all=a&_ajax=1
	/search/results/ajax?all=a&_ajax=1
	/search/suggest
	/search/suggest/TitleProper?all=a
	/editor
	/editor/template
	/editor/css
#) {
	ok( my $default = get( $url ), "get $url");
	my $site_url = "/$test_site/$url";
	$site_url =~ s#//+#/#g;
	ok( my $sites = get( $site_url ), "get $site_url" );

	# normalize site html for comparison
	$sites =~ s#/\Q$test_site\E/#/#gs;

	my $op = 'ne';
	# part which doesn't change depending on site
	$op = 'eq' if ($url =~ m#^/(editor|search/suggest)#);

	cmp_ok( $default, $op, $sites, "site content $url $op $site_url");
}

